#include <iostream>
#include <vector>
#include <string>
using namespace std;

vector<string> split(const string &s,const string &d){
     vector<string> ans;
     string ss=s;
     int index=0;
     while((index=ss.find(d))!=string::npos){
         string t=ss.substr(0,index);
         ans.push_back(t);
         index+=d.size();
         ss=ss.substr(index);
         
         //cout <<ss<< endl;
        
     }
     ans.push_back(ss);
    return ans;
}

int main() {
	vector<string> is=split("ababa","b");
	for(auto x:is){
	    cout << x <<endl;
	}
	return 0;
}